/*
 * @Author: TJN tjn@246@126.com
 * @Date: 2024-06-21 15:43:01
 * @LastEditors: TJN tjn@246@126.com
 * @LastEditTime: 2024-06-24 15:10:42
 * @FilePath: \hdcms-nest\src\auth\dto\reigster.dto.ts
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
import { IsNotEmpty, Length } from 'class-validator';
import { IsNotExists } from 'src/validate/is-not-exists';
export default class RegisterDto {
  @IsNotEmpty({ message: '用户名不能为空' })
  @Length(2, 5, { message: '用户名不能小于2个字符,不能大于5个字符' })
  @IsNotExists('user', ['name', 'mobile', 'email'], { message: '账号已存在' })
  name: string;
  @IsNotEmpty({ message: '密码不能为空' })
  @Length(5, 20, { message: '密码不能小于5个字符,不能大于20个字符' })
  password: string;
  email: string;
}
